export const getButtonPermissions = (menuData: any[]) => {
  const buttons: string[] = [];
  const extractButtons = (menus: any[]) => {
    menus.forEach(menu => {
      if (menu.type === 'button') {
        buttons.push(menu.permission);
      }
      if (menu.children?.length) {
        extractButtons(menu.children);
      }
    });
  };

  extractButtons(menuData);
  return buttons;
};
